<html>
	<head>
		<title>系统用户编辑</title>
		<meta charset="utf-8">
		<link href="../../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
		<link href="../../css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
		<link href="../../css/animate.css" rel="stylesheet">
	    <link href="../../css/plugins/dropzone/basic.css" rel="stylesheet">
	    <link href="../../css/plugins/dropzone/dropzone.css" rel="stylesheet">
		<link href="../../css/style.css?v=4.1.0" rel="stylesheet">
	</head>

	<body class="gray-bg">
		<div id="vue" v-cloak>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-sm-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">

								<form class="form-horizontal form-bordered" id="slifeForm">
									<div class="form-group">
			                            <label class="col-sm-3 control-label">头像</label>
			                            <div class="col-sm-2">
			                                <div id="localImag">
			                                    <div class="img_box" id="imgBox">
			                                        <img id="imgshowdiv" style="width: 90px" :src="sysData.headimgurl" onerror="javascript:errimg()" class="img_file img-rounded"/>
	                                                <div class="img_edit_box" v-if="sysData.headImgUrl && action != 'detail'">
	                                                  	<a class="img_desr" @click.prevent="DelPic(sysData.headImgUrl)">删除</a>
	                                              	</div>
			                                    </div>
			                                </div>
			                            </div>
										<template v-if="action != 'detail'">
				                            <div class="col-sm-6">
				                            	<label title="上传图片" for="idFront" class="btn btn-primary">
			                                        <input type="file" accept="image/*" name="file" id="idFront" @change="PicUpload($event,1)" class="hide">上传新头像
			                                    </label>
				                            </div>
										</template>
                    				</div>
									<div class="form-group">
										<label class="col-sm-3 control-label">昵称<span class="required">*</span></label>
										<div class="col-sm-8">
											<input type="text" class="form-control" placeholder="请输入昵称" name="nickname" v-model="sysData.nickname" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label">用户名<span class="required">*</span></label>
										<div class="col-sm-8">
											<input type="text" class="form-control" placeholder="请输入用户名" name="userName" v-model="sysData.userName" />
										</div>
									</div>
									<template v-if="action != 'detail'">
										<div class="form-group">
											<label class="col-sm-3 control-label">密码<span
	                                    class="required">*</span></label>

											<div class="col-sm-8">
												<div class="input-icon right">
													<input type="password" class="form-control" v-model="sysData.password" placeholder="请输入登录密码">
												</div>
											</div>
										</div>
									</template>

									<div class="form-group">
										<label class="col-sm-3 control-label">手机</label>

										<div class="col-sm-3">
											<div class="input-group">
												<input type="text" class="form-control" v-model="sysData.phone" placeholder="手机号码">
											</div>
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-3 control-label">状态</label>
										<div class="col-sm-8">
											<select class="form-control" v-model="sysData.state" name="state">
												<option value="1">启用</option>
												<option value="2">禁用</option>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label">角色</label>
										<div class="col-sm-8">
											<template v-if="action != 'detail'">
												<select class="form-control" v-model="sysData.roleId" style="width: 100%;">
													<option v-for="item in roleData" :value="item.id" >{{item.name}}</option>
												</select>
											</template>
											<template v-if="action == 'detail'">
												<select class="form-control" style="width: 100%;">
													<template v-for="rd in roleData">
														<option v-if="rd.id == sysData.roleId">{{rd.name}}</option>
													</template>
												</select>
											</template>
										</div>
									</div>

									<template v-if="action != 'detail'">
										<div class="form-group">
											<label class="col-sm-3 control-label"></label>
											<div class="col-sm-8">
												<button type="submit" class="btn btn-primary green">保存</button>
											</div>
										</div>
									</template>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 全局js -->
		<script src="../../js/jquery.min.js?v=2.1.4"></script>
		<script src="../../js/vue.js"></script>
		<script src="../../js/bootstrap.min.js?v=3.3.6"></script>
		<script src="../../js/plugins/validate/jquery.validate.min.js"></script>
		<script src="../../js/plugins/validate/messages_zh.min.js"></script>
		<script src="../../js/plugins/layer/layer.min.js"></script>
		<script src="../../js/zuoben/zuoben.js"></script>
		<script src="../../js/user/addAndEdit.js"></script>
	</body>

</html>